package com.ifgi.sitcom.campusmapperNDrawer.fragments;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.gamificationlibrary.fragment.SpinnerLeaderboardsFragment;
import com.gamificationlibrary.gamificationlibrary.R;


//PROOF in order to demonstrate that an icon can be added in a spinnerLeaderboardsFragment
//no used class!
public class GeoLeaderboardFragment extends SpinnerLeaderboardsFragment{

	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState)
	{
        // Inflate the layout for this fragment
        final View rootView= super.onCreateView(inflater, container,
                savedInstanceState);
        ImageView imgView = new ImageView(getActivity());
        imgView.setImageResource(R.drawable.ic_launcher);
            	imgView.setOnClickListener(new OnClickListener() {
        			
        			@Override
        			public void onClick(View v) {
        				// TODO Auto-generated method stub
        				
        			}
        		});
        RelativeLayout rLayout=(RelativeLayout) rootView.findViewById(R.id.relativeLayout_geoLeaderboard);
        
		rLayout.addView(imgView);
		
		//rlayout.setBackgroundColor(Color.BLACK);
		RelativeLayout.LayoutParams head_params = (RelativeLayout.LayoutParams)imgView.getLayoutParams();
		head_params.setMargins(0, 0, 5, 0); //substitute parameters for left, top, right, bottom
		
		head_params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
		imgView.setLayoutParams(head_params);
	
		return rootView; 
    }
}
